import {ref} from "vue";
import {defineStore} from "pinia";

export const authUtilStore = defineStore('auth', () => {
    const active = ref(0);
    const isRegister = ref(false);

    const toggleAuthMode = () => {
        isRegister.value = !isRegister.value;
    };

    const switchToLogin = () => {
        isRegister.value = false;
    };

    const switchToRegister = () => {
        isRegister.value = true;
    };

    return {
        active,
        isRegister,
        toggleAuthMode,
        switchToLogin,
        switchToRegister
    };
});